import axios from "axios"

export default function (user) {
    return axios({
        method: "post",
        url: "/api/users/auth",
        data: user
    })
        .then(response => {
            return {
                status: true,
                msg: response.data.token,
                identity: response.data.identity
            }
        })
        .catch(error => {
            return {
                status: false,
                msg: error.response.data.msg
            }
        });
}